
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: mudsock</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>mudsock</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
    <p><tt>Contains&nbsp;the&nbsp;Python&nbsp;wrapper&nbsp;for&nbsp;sockets,&nbsp;and&nbsp;utilities&nbsp;for&nbsp;listing<br>
currently&nbsp;connected&nbsp;sockets.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="mudsock.html#Mudsock">Mudsock</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Mudsock">class <strong>Mudsock</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Python&nbsp;Socket&nbsp;<a href="__builtin__.html#object">object</a><br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Mudsock-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__cmp__">__cmp__</a>(y)&nbsp;&lt;==&gt;&nbsp;cmp(x,y)</tt></dd></dl>

<dl><dt><a name="Mudsock-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;x.__class__.__doc__&nbsp;for&nbsp;signature</tt></dd></dl>

<dl><dt><a name="Mudsock-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias&nbsp;for&nbsp;mudsock.<a href="#Mudsock">Mudsock</a>.getAuxiliary</tt></dd></dl>

<dl><dt><a name="Mudsock-bust_prompt"><strong>bust_prompt</strong></a>(...)</dt><dd><tt><a href="#Mudsock-bust_prompt">bust_prompt</a>()<br>
&nbsp;<br>
Busts&nbsp;the&nbsp;socket's&nbsp;prompt&nbsp;so&nbsp;it&nbsp;will&nbsp;be&nbsp;displayed&nbsp;next&nbsp;pulse.</tt></dd></dl>

<dl><dt><a name="Mudsock-close"><strong>close</strong></a>(...)</dt><dd><tt><a href="#Mudsock-close">close</a>()<br>
&nbsp;<br>
Closes&nbsp;the&nbsp;socket's&nbsp;connection.</tt></dd></dl>

<dl><dt><a name="Mudsock-edit_text"><strong>edit_text</strong></a>(...)</dt><dd><tt><a href="#Mudsock-edit_text">edit_text</a>(dflt_value,&nbsp;on_complete,&nbsp;mode='text')<br>
&nbsp;<br>
Enter&nbsp;the&nbsp;text&nbsp;editor,&nbsp;and&nbsp;set&nbsp;its&nbsp;default&nbsp;value.&nbsp;When&nbsp;the&nbsp;text&nbsp;editor<br>
is&nbsp;edited,&nbsp;call&nbsp;on_complete.&nbsp;This&nbsp;function&nbsp;should&nbsp;take&nbsp;two&nbsp;arguments:<br>
the&nbsp;socket&nbsp;doing&nbsp;the&nbsp;editing,&nbsp;and&nbsp;the&nbsp;output&nbsp;of&nbsp;the&nbsp;editor.&nbsp;Mode&nbsp;can<br>
be&nbsp;'text'&nbsp;or&nbsp;'script'.</tt></dd></dl>

<dl><dt><a name="Mudsock-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Mudsock-getAuxiliary">getAuxiliary</a>(name)<br>
&nbsp;<br>
Returns&nbsp;socket's&nbsp;auxiliary&nbsp;data&nbsp;of&nbsp;the&nbsp;specified&nbsp;name.</tt></dd></dl>

<dl><dt><a name="Mudsock-pop_ih"><strong>pop_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-pop_ih">pop_ih</a>()<br>
&nbsp;<br>
Pops&nbsp;the&nbsp;socket's&nbsp;current&nbsp;input&nbsp;handler&nbsp;from&nbsp;its&nbsp;input&nbsp;handler&nbsp;stack.</tt></dd></dl>

<dl><dt><a name="Mudsock-push_ih"><strong>push_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-push_ih">push_ih</a>(handler_func,&nbsp;prompt_func,&nbsp;state=None)<br>
&nbsp;<br>
Pushes&nbsp;a&nbsp;new&nbsp;input&nbsp;handler&nbsp;and&nbsp;prompt&nbsp;pair&nbsp;onto&nbsp;the&nbsp;socket's&nbsp;input<br>
handler&nbsp;stack.&nbsp;Optionally,&nbsp;a&nbsp;(String)&nbsp;state&nbsp;value&nbsp;can&nbsp;be&nbsp;supplied.<br>
Input&nbsp;handlers&nbsp;take&nbsp;two&nbsp;arguments:&nbsp;the&nbsp;socket&nbsp;and&nbsp;a&nbsp;string&nbsp;command.<br>
Prompts&nbsp;take&nbsp;one&nbsp;argument:&nbsp;the&nbsp;socket.&nbsp;They&nbsp;should&nbsp;send&nbsp;the&nbsp;relevant<br>
text&nbsp;for&nbsp;the&nbsp;prompt&nbsp;to&nbsp;the&nbsp;socket.</tt></dd></dl>

<dl><dt><a name="Mudsock-replace_ih"><strong>replace_ih</strong></a>(...)</dt><dd><tt>repalce_ih(handler_func,&nbsp;prompt_func,&nbsp;state=None)<br>
&nbsp;<br>
Calls&nbsp;pop_ih,&nbsp;followed&nbsp;by&nbsp;push_ih.</tt></dd></dl>

<dl><dt><a name="Mudsock-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send">send</a>(mssg,&nbsp;dict&nbsp;=&nbsp;None,&nbsp;newline&nbsp;=&nbsp;True)<br>
&nbsp;<br>
Sends&nbsp;message&nbsp;to&nbsp;the&nbsp;socket.&nbsp;Messages&nbsp;can&nbsp;have&nbsp;scripts&nbsp;embedded&nbsp;in<br>
them,&nbsp;using&nbsp;[&nbsp;and&nbsp;].&nbsp;If&nbsp;so,&nbsp;a&nbsp;variable&nbsp;dictionary&nbsp;must&nbsp;be&nbsp;provided.&nbsp;By<br>
default,&nbsp;'me'&nbsp;references&nbsp;the&nbsp;socket&nbsp;being&nbsp;sent&nbsp;the&nbsp;message.</tt></dd></dl>

<dl><dt><a name="Mudsock-send_raw"><strong>send_raw</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send_raw">send_raw</a>(mssg)<br>
&nbsp;<br>
Sends&nbsp;text&nbsp;to&nbsp;the&nbsp;socket.&nbsp;No&nbsp;appended&nbsp;newline.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>account</strong></dt>
<dd><tt>The&nbsp;account&nbsp;currently&nbsp;attached&nbsp;to&nbsp;the&nbsp;socket,&nbsp;or&nbsp;None.&nbsp;Immutable.<br>
see&nbsp;mudsys.attach_account_socket&nbsp;for&nbsp;connecting&nbsp;sockets&nbsp;and&nbsp;accounts.</tt></dd>
</dl>
<dl><dt><strong>can_use</strong></dt>
<dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;the&nbsp;socket&nbsp;is&nbsp;ready&nbsp;for&nbsp;use.&nbsp;Socket&nbsp;becomes&nbsp;available<br>
after&nbsp;its&nbsp;dns&nbsp;addresss&nbsp;resolves.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>ch</strong></dt>
<dd><tt>Alias&nbsp;for&nbsp;mudsock.Mudsock.character.</tt></dd>
</dl>
<dl><dt><strong>char</strong></dt>
<dd><tt>Alias&nbsp;for&nbsp;mudsock.Mudsock.character</tt></dd>
</dl>
<dl><dt><strong>character</strong></dt>
<dd><tt>The&nbsp;character&nbsp;currently&nbsp;attached&nbsp;to&nbsp;the&nbsp;socket,&nbsp;on&nbsp;None.&nbsp;Immutable.<br>
see&nbsp;mudsys.attach_char_socket&nbsp;for&nbsp;connecting&nbsp;characters&nbsp;to&nbsp;account.</tt></dd>
</dl>
<dl><dt><strong>has_input</strong></dt>
<dd><tt>True&nbsp;or&nbsp;False&nbsp;if&nbsp;the&nbsp;socket&nbsp;has&nbsp;any&nbsp;input&nbsp;pending.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>hostname</strong></dt>
<dd><tt>The&nbsp;dns&nbsp;address&nbsp;that&nbsp;the&nbsp;socket&nbsp;is&nbsp;connected&nbsp;from.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>idle_time</strong></dt>
<dd><tt>How&nbsp;long&nbsp;(in&nbsp;seconds)&nbsp;the&nbsp;socket's&nbsp;input&nbsp;handler&nbsp;has&nbsp;been&nbsp;idle&nbsp;for.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>outbound_text</strong></dt>
<dd><tt>The&nbsp;socket's&nbsp;outbound&nbsp;text.</tt></dd>
</dl>
<dl><dt><strong>state</strong></dt>
<dd><tt>The&nbsp;state&nbsp;that&nbsp;the&nbsp;socket&nbsp;is&nbsp;in.&nbsp;Immutable.&nbsp;For&nbsp;more&nbsp;on&nbsp;states&nbsp;see<br>
mudsock.Mudsock.push_ih</tt></dd>
</dl>
<dl><dt><strong>uid</strong></dt>
<dd><tt>The&nbsp;socket's&nbsp;uid.&nbsp;Immutable.</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object at 0x6f980&gt;<dd><tt>T.<a href="#Mudsock-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-socket_list"><strong>socket_list</strong></a>(...)</dt><dd><tt><a href="#-socket_list">socket_list</a>()<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;sockets&nbsp;currently&nbsp;connected.</tt></dd></dl>
</td></tr></table>
</body></html>